/**
 * 
 */
package edu.neelsys.business.userauth;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import edu.neelsys.objectmodel.dbentites.Registration;
import edu.neelsys.objectmodel.dbentites.User;
import edu.neelsys.objectmodel.dbentites.UserRoleEnum;
import edu.neelsys.repository.user.UserRepository;

/**
 * @author Administrator
 * 
 */
@Service
public class UserService {

	@Autowired
	UserRepository userRepository;

	public void createUser(User registrationForm) {

		try {

			registrationForm.setUserRole(UserRoleEnum.ROLE_USER);

			userRepository.save(registrationForm);

		} catch (Exception e) {
			// TODO: handle exception
		}
	}

	public void updateUser(User user) {
		userRepository.save(user);
	}

}